package cn.itcast.mapper;

import cn.itcast.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//@Mapper
public interface IEmployeeMapper {
    @Select("select * from employee where username =#{username}")
    Employee fingByUsername(Employee employee);
    @Insert("insert  into employee values(null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},1" +
            ",#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void save(Employee employee);
     //查询全部
    List<Employee> findByName(String name);

    void update(Employee employee);

    @Select("select * from employee where id =#{id}")
    Employee findById(Long id);
}
